1. Field of the Invention
The present invention relates to the field of DVD (Digital Versatile Disk) technology. There are several types of DVD. This invention relates to DVD-video. More specifically, the present invention relates to the rendering of a DVD-video subpicture on a computer system without loss of color resolution.
2. The Background
DVD technology has grown in popularity in recent years. Many households now own a DVD player next to their television sets. Even more dramatically, however, nearly every computer sold now has a DVD-ROM player built into it. There are several problems that are encountered when attempting to play DVDs on a computer that are not encountered when attempting to play them on a traditional DVD player.
When playing a DVD-video on a computer, it is necessary to convert the picture to one that not only can be displayed on a computer monitor, but also may be integrated in to the existing operating system being run. An operating system usually has a user interface containing one or more windows which may run different programs. When a DVD is to be played on a computer, normally a new window must be open. However, other windows on the desktop may also be left open. Therefore, the video displayed in the DVD window must be of the same format (colors, resolution, etc.) as the rest of the desktop and the other windows in order to be properly displayed on the computer screen.
Another problem with displaying DVD video on a computer via hardware or software comes in how the video is decoded. DVD video is actually made up of two distinct pieces of video: the video and the subpicture. The video holds the data which is normally a movie or show, such as a direct translation of a film. The subpicture may hold other pieces of information specially designed for the DVD. This commonly includes things such as menus, closed captioning text, subtitles, etc. The video is encoded according to the MPEG-2 standard. The subpicture is encoded using run length encoding. The subpicture is a rectangle which can be any size up to the size of the video, and is blended with the video at a specified location.
Generally, a pixel of video information may be represented by RGB values (a value for each of the three primary colors- red, green, and blue) or by YUV values. A luminance value, denoted as Y, represents the brightness, or intensity, of a pixel. U and V are chrominance values, which together represent the color of a pixel in terms of hue and saturation. U and V are sometimes represented as Cr and Cb. Cb (representing blue information) is equal to B-Y and Cr (representing red information) is equal to R-Y. The green value is not used in a separate color component since it can be derived by subtracting the two difference signals from the Y signal. The YCbCr format is one type of YUV format, which generally refers to a form of color-difference video signal containing one luma and two chroma components.
The DVD video is encoded as MPEG-2, which uses a 4:2:0 YCbCr component digital video format, indicating that there is one Cb sample and one Cr sample for every four Y samples. This also indicates that there is 2:1 horizontal downsampling and 2:1 vertical downsampling for the chrominance samples in relation to the luminance samples.
The subpicture video stream, however, uses a format equivalent to a 4:4:4 YCbCr digital video format, indicating that Cb, Cr, and Y are sampled equally and there is no downsampling of the chrominance samples. This results in more color resolution being available for the subpicture than the video stream. The subpicture stream also contains information on how to blend each subpicture pixel with the corresponding video pixel. The value which controls this blending is called the alpha value.
When the DVD is played, the video data is blended with the subpicture data to produce a single image on the screen. In the past, DVD decoders generally decoded the MPEG-2 video data into a video surface as a 4:2:0 YCbCr format picture. Then, the subpicture was also decoded and converted to 4:2:0 YCbCr, then blended with the video by the DVD decoder, resulting in a loss of color resolution. Decoding the subpicture data, converting it to the primary surface color RGB format, then writing it directly into the primary surface is generally not done because most primary surface color modes do not support an alpha value. Any RGB mode without an alpha value (24 bit or less primary surface) would require a fixed alpha to be used, thus dithering the data, which significantly reduces the quality of the subpicture data. This is due to the fact that the display pipeline (in the graphics chip) only knows how to read the video data in a single way for a particular primary surface color format. For example, if the primary surface is currently set to 24-bit RGB mode, the display pipe will be expecting data to be in an 8-8-8 format (8 bits for each of the red, green, and blue primary colors). It does not know how to handle any other format, and this format does not include an alpha component. Thus, the display pipe requires that the subpicture data be transformed into a format it can handle, resulting in the possible loss of subpicture resolution and a loss of the alpha values.
What is needed is a solution which allows for the blending of DVD subpicture data with DVD video data and graphics information without losing subpicture color resolution.